<template>
    <div class="in">
        <div class="index2">
            <div class="iin">
                <div class="index2_1">
                    <span class="ti1" v-for="i in Sub_route" :key="i" :style="[{borderBottom: name===i?'3px solid #00c3ff':''},{color: name===i?'#00c3ff':''}]" @click="route(i)">{{i}}</span>
                </div>
                <div class="index2_2">
                    <i class="el-icon-edit"></i>
                    <div>发布帖子</div>
                </div>
            </div>
        </div>
        <div class="index">
            <div class="w1">
                <LatestP :the_data1="data_source1" :the_data2="data_source2"></LatestP>
            </div>
            <div class="w2">
                <!-- <div class="search">
                    <router-view />
                </div> -->
                <div class="w2_2">
                    <div class="w2_2_1">
                        <div class="uia1">
                            <img src="https://img-static.mihoyo.com/new_qrcode/qrcode_ys.png" width="100px" alt="">
                            <div class="uia1_1">
                                <span class="ti1">扫码下载米游社App</span>
                                <span class="ti2">了解提瓦特最新资讯</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="w2_4">
                    <div class="w2_4_index">
                        <div class="una1">
                            <span>官方资讯</span>
                        </div>
                        <div class="una2">
                            <span>更多</span>
                        </div>
                    </div>
                    <div class="w2_4_index2">
                        <div class="im">
                            <img src="https://upload-bbs.mihoyo.com/upload/2022/04/29/75379477/2ea09aee020e97b68be4110fdce6f32b_5216870197910584003.jpg?x-oss-process=image/resize,s_300/quality,q_80/auto-orient,0/interlace,1/format,jpg" alt="">
                            <span class="kjg" title="【有奖活动】「裁景入画」旅照札记摄影征集活动开启！">【有奖活动】「裁景入画」旅照札记摄影征集活动开启！</span>
                        </div>
                        <div class="im2" v-for="item,i in guangfang" :key="i">
                            <span class="huo">{{item.name}}</span>
                            <span class="jie">{{item.title}}</span>
                        </div>
                    </div>
                </div>
                <div class="w2_5">
                    <div class="w2_5_index">
                        <div class="una1">
                            <span>热门话题</span>
                        </div>
                        <div class="una2">
                            <span>更多</span>
                        </div>
                    </div>
                    <div class="w2_5_index2">
                        <div class="tiing" v-for="i in 20" :key="i">
                            <img src="https://upload-bbs.mihoyo.com/upload/2022/04/29/7078d15984ddbbb8aaa6280a9cb86407_5699639779014808393.gif?x-oss-process=image/auto-orient,0/interlace,1/format,jpg" alt="">
                            <span>不是吧老铁</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <el-backtop :bottom="300" :right='300'> 
            <img src="../assets/img/top.png" alt="">
        </el-backtop>
    </div>
</template>

<script>
import LatestP from '../components/Tavern routing/THot.vue'

export default {
    components: {LatestP},
    data() {
        return {
            name: '热门',
            Sub_route: ['最新发帖', '最新回复', '热门'],
            data_source1: null, // 帖子数据
            data_source2: null, // 置顶数据
            // 置顶
            topping: [
                {id: 1, title: '置顶la', name: '【公告】米游社硬核讨论区版规'},
                {id: 1, title: '置顶la', name: '【公告】米游社硬核讨论区版规'},
            ],
            // 热门
            data1: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
            // 最新回复
            data2: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
            // 最新发帖
            data3: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
            guangfang: [
                {name: '活动', title: '从你少女i发VS篇v你是否不顾i打不过打不过打不过跑环任务交割日无法'},
                {name: '资讯', title: '从你少女i发VS篇v你是否不顾i打不过打不过打不过跑环任务交割日无法'},
                {name: '资讯', title: '从你少女i发VS篇v你是否不顾i打不过打不过打不过跑环任务交割日无法'},
                {name: '公告', title: '从你少女i发VS篇v你是否不顾i打不过打不过打不过跑环任务交割日无法'},
                {name: '公告', title: '从你少女i发VS篇v你是否不顾i打不过打不过打不过跑环任务交割日无法'},
            ],
        }
    },
    mounted() {
        this.First_pass()
    },
    methods: {
        First_pass() {
            this.data_source1 = this.data1
        },
        route(i) {
            this.name = i
            if(i === '最新发帖') {
                // this.$router.push('/TLatest post')
                // this.pp = [{p: 11, n: 22}]
                this.data_source1 = this.data3
                this.data_source2 = this.topping
            }else if(i === '最新回复') {
                // this.$router.push('/TLatest reply')
                // this.pp = [{p: 99, n: 88}]
                this.data_source1 = this.data2
                this.data_source2 = this.topping
            }else if(i === '热门') {
                // this.$router.push('/THot')
                this.data_source1 = this.data1
                this.data_source2 = null
            }
        }
    }
}
// mi_youshe
</script>
<style lang="less" scoped>
    .el-backtop img {
        max-width: 100px;
    }
    .in {
        width: 100%;
        background-color: #f7f5f5;
        .index {
            border: 1px solid red;
            display: flex;
            margin-top: 80px;
            justify-content: center;
            // border: 1px solid red;
            .w2 {
                display: flex;
                justify-content: center;
                flex-wrap: wrap;
                width: 260px;
                height: 100%;
                // background-color: red;
                // border: 1px solid red;
                // overflow: hidden;
                .search {
                    // border: 1px solid red;
                    border-radius: 5px;
                    width: 94%;
                    height: 60px;
                    display: flex;
                    align-items: center;
                    background-color: white;
                    // .search_1 {
                    //     // border: 1px solid red;
                    //     padding: 10px;
                    //     input {
                    //         width: 150px;
                    //         border: none;
                    //         outline: none;
                    //     }
                    // }
                    // .search_2 {
                    //     // border: 1px solid red;
                    //     width: 100%;
                    //     height: 100%;
                    //     display: flex;
                    //     align-items: center;
                    //     justify-content: center;
                    //     background-color: #f3f320;
                    //     border-radius: 0px 5px 5px 0px;
                    //     cursor: pointer;
                    // }
                }
                .w2_2 {
                    background-color: white;
                    // margin-top: 20px;
                    // border: 1px solid red;
                    width: 95%;
                    height: 130px;
                    border-radius: 5px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    flex-wrap: wrap;
                    cursor: pointer;
                    .w2_2_1 {
                        // border: 1px solid rgb(0, 0, 0);
                        width: 90%;
                        .uia1 {
                            display: flex;
                            align-items: center;
                            // border: 1px solid black;
                            .uia1_1 {
                                // border: 1px solid red;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                flex-wrap: wrap;
                                font-size: 13px;
                                .ti1 {
                                    color: #00c3ff;
                                }
                                .ti2 {
                                    margin-top: 6px;
                                    color: #999;
                                }
                            }
                        }
                    }
                }
                .w2_4 {
                padding-bottom: 30px;
                background-color: white;
                width: 95%;
                margin-left: 6px;
                margin-top: 20px;
                display: flex;
                justify-content: center;
                flex-wrap: wrap;
                .w2_4_index {
                    // border: 1px solid red;
                    border-bottom: 1px solid #999;
                    width: 90%;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    padding: 5px;
                    .una1 {
                        font-size: 16px;
                        font-weight: bolder;
                    }
                    .una2 {
                        font-size: 10px;
                        color: #999;
                        cursor: pointer;
                    }
                }
                .w2_4_index2 {
                    // border: 1px solid red;
                    display: flex;
                    justify-content: center;
                    flex-wrap: wrap;
                    .im {
                        // border: 1px solid red;
                        cursor: pointer;
                        margin-top: 10px;
                        display: flex;
                        flex-wrap: wrap;
                        position: relative;
                        img {
                            max-width: 220px;
                            border-radius: 5px;
                        }
                        .kjg {
                            // border: 1px solid red;
                            position: absolute;
                            bottom: 0;
                            font-size: 10px;
                            color: white;
                            background-color: black;
                            opacity: 0.5;
                            display: -webkit-box;
                            -webkit-box-orient: vertical;
                            -webkit-line-clamp: 1;
                            overflow: hidden;
                        }
                    }
                    .im2 {
                        // border: 1px solid red;
                        cursor: pointer;
                        margin-top: 10px;
                        width: 90%;
                        display: flex;
                        justify-content: space-between;
                        justify-content: center;
                        align-items: center;
                        font-size: 6px;
                        .huo {
                            // border: 1px solid red;
                            width: 50px;
                            padding: 3px;
                            text-align: center;
                            border-radius: 4px;
                            background-color: #999;
                            color: white;
                        }
                        .jie {
                            // border: 1px solid red;
                            margin-left: 10px;
                            display: -webkit-box;
                            -webkit-box-orient: vertical;
                            -webkit-line-clamp: 1;
                            overflow: hidden;
                        }
                    }
                }
                }
                .w2_5 {
                    padding-bottom: 30px;
                    background-color: white;
                    // padding: 10px;
                    margin-top: 20px;
                    width: 95%;
                    margin-left: 6px;
                    display: flex;
                    justify-content: center;
                    flex-wrap: wrap;
                    .w2_5_index {
                        border-bottom: 1px solid #999;
                        width: 90%;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        padding: 5px;
                        .una1 {
                            font-size: 16px;
                            font-weight: bolder;
                        }
                        .una2 {
                            font-size: 10px;
                            color: #999;
                            cursor: pointer;
                        }
                    }
                    .w2_5_index2 {
                        // border: 1px solid red;
                        .tiing {
                            // border: 1px solid red;
                            cursor: pointer;
                            margin-top: 8px;
                            width: 230px;
                            display: flex;
                            // justify-content: center;
                            align-items: center;
                            img {
                                max-width: 50px;
                                border-radius: 4px;
                            }
                            span {
                                margin-left: 10px;
                            }
                            span:hover {
                                color: #00c3ff;
                            }
                        }
                    }
                }
            }
        }
        .index2 {
            // border: 1px solid red;
            opacity: 1;
            // position: absolute;
            z-index: 2;
            position: fixed;
            top: 120;
            width: 100%;
            background-color: white;
            height: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
            .iin {
                // border: 1px solid red;
                width: 50%;
                height: 100%;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .index2_1 {
                    height: 100%;
                    // border: 1px solid black;
                    display: flex;
                    align-items: center;
                    span {
                        // border: 1px solid red;
                        display: flex;
                        align-items: center;
                        height: 100%;
                        margin-left: 10px;
                        font-size: 19px;
                        // color: rgb(0, 255, 255);
                        // border-bottom: 2px solid rgb(0, 255, 255);
                        cursor: pointer;
                    }
                }
                .index2_2 {
                    width: 120px;
                    background-color: #ffe14c;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    margin-right: 30px;
                    padding: 10px;
                    font-weight: bolder;
                    border-radius: 5px;
                    cursor: pointer;
                    i {
                        font-size: 20px;
                    }
                }
            }
        }
    }
</style>